package com.int_tech.station.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by Administrator on 2017/9/22.
 * 场站信息
 */
@Entity
@Table(name = "c_station")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class Station {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(length = 8)
    private Integer id;

    //场站code
    @Column(length = 8)
    private int stationCode;

    //场站名称
    @Column(length = 64)
    private String name;

    //客户id
    @Column(length = 8)
    private int clientId;

    //客户名称
    @Column(length = 64)
    private String clentName;

    //具体地址
    @Column(length = 640)
    private String address;


    //地理坐标，多组坐标用&分隔
    @Column(length = 1024)
    private String area;

    //是否删除（1，删除；0，正常）
    @Column(length = 2)
    private int isDel;

    //创建时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(updatable = false)
    private Date createTime;

    //修改时间
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    //本场站车辆数量，不存库
    @Transient
    private int carCount;
}
